<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

</head>
<body>
	<%
		String id = request.getParameter("id");
		int ID = Integer.parseInt(id);
		String name = request.getParameter("name");
		String image = request.getParameter("image");
		String address = request.getParameter("at");
		String district = request.getParameter("district");
		String city = request.getParameter("city");
		String state = request.getParameter("state");
		String zip = request.getParameter("zip");
		String email = request.getParameter("email");
		String mob = request.getParameter("mob");
		String sex = request.getParameter("sex");
		String course = request.getParameter("course");
		String course_fee = request.getParameter("course_fee");
		String paid = request.getParameter("paid");
		
		try {
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			Connection connection = DriverManager
					.getConnection("jdbc:mysql://localhost:3306/STUDENTS",
							"root", "sannu");
			PreparedStatement ps = connection
					.prepareStatement("update REGISTRATION set name='"
							+ name + "',image='" + image + "',at='"
							+ address + "',district='" + district
							+ "',city='" + city + "',state='" + state
							+ "',zip='" + zip + "',email='" + email
							+ "',mob='" + mob + "',sex='" + sex
							+ "',course='" + course + "',course_fee='"
							+ course_fee + "',paid='" + paid
							+ "',where id='" + ID + "'");
			ps.executeUpdate();
			System.out.println("After execution of query");
			response.sendRedirect("DataRetrive.jsp");
		} catch (Exception e) {
			System.out.println(e);
		}
	%>

</body>
</html>